package l.l.test.ThinkingInJava;

/**
 * Created by llw on 2018/1/15.
 */
class Glyph{
    int a = 1;
    private int b = 2;
    void draw(){
        System.out.println("Glyph.draw()");
    }
    Glyph(){
        System.out.println("Glyph() before draw()");
        draw();
        System.out.println("a= " + this.a);
        System.out.println(this.getClass().getName());
        System.out.println("Glyph() after draw()");
    }
    public Number test(Number n){
        return new Integer(123);
    }
}
class RoundGlyph extends Glyph{
    private int radius = 1;
    int a = 2;
    RoundGlyph(int r){
        radius = r;
        System.out.println("RoundGlyph.RoundGlyph(), radiux = " + radius);
//        b = 2;
    }
    @Override
    void draw(){
        System.out.println("RoundGlyph.draw(), radiux = " + radius);
    }

    @Override
    public Integer test(Number n){
        return new Integer(123);
    }
}
public class DuoTaiInConstructor {
    public static void main(String[] args) {
        new RoundGlyph(5);
    }
}
